package com.firewolf.shiro.shiroservice;

import org.junit.Test;

import com.firewolf.permission.utils.ShiroUtil;

public class ShiroPasswordServiceDriver {

	@Test
	public void testPasswordServiceWithMyRealm() {
		ShiroUtil.login("shiro-passwordservice.ini", "wu", "123");
	}

	@Test
	public void testPasswordServiceWithJdbcRealm() {
		ShiroUtil.login("shiro-jdbc-passwordservice.ini", "wu", "123");
	}

	@Test
	public void testRetryLimitHashedCredentialsMatcherWithMyRealm() {
		for (int i = 1; i <= 5; i++) {
			try {
				ShiroUtil.login("shiro-retryLimitHashedCredentialsMatcher.ini", "liu", "235");
			} catch (Exception e) {
				/* ignore */}
		}
		ShiroUtil.login("shiro-retryLimitHashedCredentialsMatcher.ini", "liu", "234");
	}

}
